angular.module('moti.services.spotsService', ['restangular'])
    .factory('SpotsInterface', ['Restangular', 'Auth', function(Restangular, Auth){
        var spots = Restangular.all('admin');
        return {
            //创建景点
            postSpot : function(region_id, request_body){
                return spots.customPOST(request_body, INTERFACE_API.SPOTS.replace(":region_id", region_id), {}, Auth);
            },
            //获取景点
            getSpot : function(region_id, spot_id){
                return spots.customGET(INTERFACE_API.SPOTDETAIL.replace(":region_id", region_id).replace(":spot_id", spot_id), {}, Auth);
            },
            //修改景点
            putSpot : function(region_id, spot_id, request_body){
                return spots.customPUT(request_body, INTERFACE_API.SPOTDETAIL.replace(":region_id", region_id).replace(":spot_id", spot_id), {}, Auth);
            },
            //删除景点
            deleteSpot : function(region_id, spot_id){
                return spots.customDELETE(INTERFACE_API.SPOTDETAIL.replace(":region_id", region_id).replace(":spot_id", spot_id), {}, Auth);
            }
        }
    }]);